from selenium import webdriver
from selenium.webdriver.edge.options import Options
from selenium.webdriver.common.by import By
import time


# 设置浏览器、启动浏览器
def create_driver():
    options = Options()
    options.add_argument('--no-sandbox')
    options.add_experimental_option("detach", True)
    driver_edge = webdriver.Edge(options=options)
    return driver_edge
driver = create_driver()

driver.get("http://teacher.recttech.cn/luggage-calculator/")
# input框内容输入
driver.find_element(By.XPATH, '//*[@id="luggageWeight"]').send_keys('7')
# 单选
driver.find_element(By.XPATH, '//*[@id="luggageForm"]/div[2]/div/div[1]/label').click()
# 多选
driver.find_element(By.XPATH, '//*[@id="luggageForm"]/div[4]/label').click()
# 点击按钮
driver.find_element(By.XPATH, '//*[@id="calculateBtn"]').click()
